#ifndef TILEMAP_HPP
#define TILEMAP_HPP

#include <SFML/Graphics.hpp>
#include <SFML/Graphics/Drawable.hpp>

typedef struct
{
    sf::Sprite _Sprite;
    int _Type;
} Tile;

class TileMap : public sf::Drawable
{
    public:
        // map width, map height, tile width, tile height
        TileMap(int, int, int, int);
        virtual ~TileMap();

        void newMap();

    protected:
    private:

        const int MAP_WIDTH, MAP_HEIGHT, TILE_WIDTH, TILE_HEIGHT;

        //sf::Texture _spriteTextures[2];
        sf::Texture _spriteTexture;
        std::vector<sf::Sprite> _tileSprites;

        std::vector<Tile> _Map;

        void createTileSheet(std::string fname, unsigned int tWidth, unsigned int tHeight);


        void init_tiles();
        void generate_grass();

        virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const;
};

#endif // TILEMAP_HPP
